Carbon


GetCTable

Header: Quickdraw.h Carbon status: Supported

Obtains a color table stored in a 'clut' resource.

CTabHandle GetCTable (
    SInt16 ctID
);
Parameter descriptions
ctID

The resource ID of a 'clut' resource.

function result

A handle to the color table. If the 'clut' resource with that ID is not found, GetCTable returns NULL.Before you place this handle in the pmTable field of a PixMap structure, first use the DisposeCTable function to dispose of the handle already there.

DISCUSSION

Before you modify a ColorTable structure, change its ctSeed field to invalidate it. To do this, use the CTabChanged function.

The GetCTable function recognizes a number of standard 'clut' resource IDs. You can obtain the default grayscale color table for a given pixel depth by calling GetCTable, adding 32 (decimal) to the pixel depth, and passing these values in the ctID parameter:

For full color, obtain the default color tables by adding 64 to the pixel depth and passing these values in the ctID parameter:

SPECIAL CONSIDERATIONS

The GetCTable function may move or purge memory blocks in the application heap; do not call this function at interrupt time.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)